using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Text;
using System.Windows.Forms;

namespace Banshee.Controls
{
    public class ToolTipButton:Button
    {
        public ToolTipButton()
        {

        }
        private string toolTip;

        public string ToolTip
        {
            get { return toolTip; }
            set { toolTip = value; }
        }
        protected override void OnMouseHover(EventArgs e)
        {
            base.OnMouseHover(e);
            /*if(!string.IsNullOrEmpty(toolTip))
                ShowToolTip(toolTip);*/
        }
        Control tipcontrol = null;
        void ShowToolTip(string tip)
        {
            tipcontrol = new Control();
            tipcontrol.SetBounds(this.Bounds.X, this.Bounds.Y + this.Width, 150, 36);
            Graphics g = this.CreateGraphics();
            Rectangle tiprect = tipcontrol.Bounds;
            using (LinearGradientBrush brush = new LinearGradientBrush(tiprect,Color.Gainsboro,Color.WhiteSmoke,LinearGradientMode.Vertical))
            {
                g.DrawRectangle(Pens.Black, tiprect);
                tiprect.Inflate(-2, -2);
                g.FillRectangle(brush, tiprect);
                g.DrawString(tip, this.Font, Brushes.Black, Rectangle.Round(tiprect));
            }
            tipcontrol.Show();
        }
    }
}
